import { tradeMark } from "../trademark/type"

// spu管理模块相关数据类型

export interface ResponseData {
  code: number,
  message: string,
  ok: boolean
}

export interface SpuData {
  id?: number,
  spuName: string,
  description: string,
  category3Id: string | number,
  tmId: number | string,
  spuSaleAttrList: null | SaleAttr[],
  spuImageList: null | spuImg[]
}

export type Records = SpuData[]

export interface HasSpuResponseData extends ResponseData {
  data: {
    records: Records,
    total: number,
    size: number,
    current: number,
    searchCount: boolean,
    pages: number
  }
}

export interface AllTradeMark extends ResponseData {
  data: tradeMark[]
}

export interface spuImg {
  id?: number,
  createTime?: string,
  updateTime?: string,
  spuId?: number,
  imgName?: string,
  imgUrl?: string
}

export interface SpuHasImg extends ResponseData {
  data: spuImg[]
}

export interface SaleAttrValue {
  id?: number,
  createTime?: null,
  updateTime?: null,
  spuId?: number,
  baseSaleAttrId: number,
  saleAttrValueName?: string,
  isChecked?: boolean
}

export type SpuSaleAttrValueList = SaleAttrValue[]

export interface SaleAttr {
  id?: number,
  createTime?: null,
  updateTime?: null,
  spuId?: number,
  baseSaleAttrId: number,
  saleAttrName: string,
  spuSaleAttrValueList: SpuSaleAttrValueList,
  flag?: boolean,
  saleAttrValue?: string
}

export interface SaleAttrResponseData extends ResponseData {
  data: SaleAttr[]
}

export interface HasSaleAttr {
  id: number,
  name: string
}

export interface HasSaleAttrResponseData extends ResponseData {
  data: HasSaleAttr[]
}
export interface Attr {
  attrId: number | string,
  valueId: number | string
}
export interface saleAttr {
  saleAttrId: string | number,
  saleAttrValueId: string | number
}

export interface skuData {
  category3Id: string | number,
  spuId: string | number,
  tmId: string | number,
  skuName: string,
  price: string | number,
  weight: string | number,
  skuDesc: string,
  skuAttrValueList: Attr[],
  skuSaleAttrValueList: saleAttr[],
  skuDefaultImg: ''
}

export interface skuInfoData extends ResponseData {
  data:[]
}